package com.yuke.cloud.service.wmc.dao;

import com.yuke.cloud.common.core.mybatis.MyMapper;
import com.yuke.cloud.service.api.pmc.dto.ProdSpecInfoExDto;
import com.yuke.cloud.service.api.wmc.dto.StorageDto;
import com.yuke.cloud.service.api.wmc.dto.StorageSpecInfoDto;
import com.yuke.cloud.service.api.wmc.dto.WareProductDto;
import com.yuke.cloud.service.wmc.dto.WmsStatisticsDto;
import com.yuke.cloud.service.wmc.dto.WmsStorageDto;
import com.yuke.cloud.service.wmc.dto.WmsStoragePicDto;
import com.yuke.cloud.service.wmc.dto.WmsStorageProdDto;
import com.yuke.cloud.service.wmc.entity.WmsStorage;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface WmsStorageMapper extends MyMapper<WmsStorage> {
    List<WmsStorage> getStorageNum(@Param("list") List<StorageDto> dto);

    void updatewarehousestorageznum(@Param("warehouseId") Long transferWarehouseId,@Param("specId") Long transferSpecId, @Param("num") Integer transferNum);


    void updatewarehousestoragefnum(@Param("warehouseId") Long transferWarehouseId,@Param("specId") Long transferSpecId, @Param("num") Integer transferNum);

    List <Map<String, Object>> getCityStockCount(@Param("specIds") List<Long> specIds, @Param("regionCityId") Long regionCityId);

    List <Map<String, Object>> getCityAllStockCount(@Param("regionCityId") Long regionCityId);

    void updateWarehouseStorage(@Param("warehouseId") Long warehouseId, @Param("specId") Long specId, @Param("number") Integer number, @Param("lockNumber") Integer lockNumber);

	void updateStorageData(@Param("warehouseId") Long warehouseId, @Param("specId") Long specId, @Param("number") Integer number,
                           @Param("purchasePrice") Integer purchasePrice, @Param("quality") Integer quality);

    List<WareProductDto> getRemoteStockCount(@Param("specIds") List<Long> specIds, @Param("localWarehouseId") Long localWarehouseId);

    List <Map<String, Object>> getWarehouseStockCount(@Param("warehouseId") Long warehouseId, @Param("specIds") List<Long> specIds);
    void addGoodsStorage(@Param("wmsStorageDto") List<WmsStorageDto> wmsStorageDto);

    List<WmsStorage> getStorageInfo();

    void updateByStorageDtos(@Param("storageDtos") List<StorageDto> storageDtos);

    List<StorageSpecInfoDto> getAppStorageSpecByCondition(@Param("storageSpecInfoDto") StorageSpecInfoDto storageSpecInfoDto);

    List<StorageSpecInfoDto> getListRecommend();

    List<StorageSpecInfoDto> getStorageInfoByCategoryIds(@Param("categoryIds") List<Long> categoryIds, @Param("warehouseId") Long warehouseId);
    List<StorageSpecInfoDto> getBrandsByCategorys(@Param("categoryIds") List<Long> categoryIds, @Param("specName") String specName, @Param("saleType") Byte saleType, @Param("warehouseId") Long warehouseId);

    List<StorageSpecInfoDto> getStorageInfoBySpecIds(@Param("specIds") List<Long> specIds, @Param("warehouseId") Long warehouseId);

    List<ProdSpecInfoExDto> getStorageSpecBySpecIds(@Param("cartType") Byte cartType,@Param("warehouseId") Long warehouseId, @Param("specIds") List<Long> specIds );
    List<WmsStorageProdDto> getStorageSpec(@Param("wmsStorageProdDto")WmsStorageProdDto wmsStorageProdDto);
    List<WmsStorage> getWmsStorageByPic(@Param("wmsStoragePicDto")WmsStoragePicDto wmsStoragePicDto);
    List<WareProductDto> getInfoWarehouseIds(@Param("specIds")List<Long> specIds);
    List<StorageSpecInfoDto> getProdSpecInfo(@Param("specIds")List<Long> specIds);
    List<ProdSpecInfoExDto> getStorageSpecByStorageIds(@Param("storageIds") List<Long> storageIds,@Param("cartType") Byte cartType);
   // List<StorageDto> getWmsSpecInfoBySpecIds(@Param("warehouseId") Long warehouseId, @Param("specIds")List<Long> specIds);
   List<WmsStorage> getWmsStorageByCondition(@Param("wmsStoragePicDto")WmsStoragePicDto wmsStoragePicDto);
    List<StorageSpecInfoDto> getAllStorageInfoBySpecIds(@Param("specIds") List<Long> specIds, @Param("warehouseId") Long warehouseId);
    List<StorageSpecInfoDto> getAllStorageBySpecIds(@Param("specIds") List<Long> specIds, @Param("warehouseId") Long warehouseId);
    List<StorageSpecInfoDto> getProdSpecGoods(@Param("storageSpecInfoDto") StorageSpecInfoDto storageSpecInfoDto);
    List<StorageSpecInfoDto> getWmsCategoryBrand(@Param("prodCategoryBrandDto") StorageSpecInfoDto prodCategoryBrandDto);
    List<StorageDto> getStorageInfoByStorageId(@Param("storageIds") List<Long> storageIds);
    List<StorageDto> selectWmsSpecsByProductId(@Param("storageDto") StorageDto storageDto);
    List<StorageSpecInfoDto> getProductSpecByCondition(@Param("storageSpecInfoDto") StorageSpecInfoDto storageSpecInfoDto);

    List<WmsStatisticsDto> storageAndUnitPrice(WmsStatisticsDto wmsStatisticsDto);

}
